package kandl.automation.spring.config;

import java.net.MalformedURLException;
import java.net.URL;

import kandl.automation.reporting.LoggingResultReporter;
import kandl.automation.reporting.ResultReporter;
import kandl.automation.steprunner.selenium.RemoteWebDriverFactory;
import kandl.automation.steprunner.selenium.WebDriverFactory;
import kandl.automation.steprunner.selenium.WindowsWebDriverFactory;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
@Profile("windows")
public class WindowsConfig {

    @Bean
    public WebDriverFactory webDriverFactory(@Value("${webdriver.ie.driver}") String ieLoc,
                                             @Value("${webdriver.chrome.driver}") String chromeLoc) {
        return new WindowsWebDriverFactory(ieLoc, chromeLoc);
    }
	
/*	 @Bean
    public WebDriverFactory webDriverFactory(@Value("${selenium.saucelabs.url}") String url) throws MalformedURLException {
        return new RemoteWebDriverFactory(new URL(url));
    }*/

    @Bean
    public ResultReporter resultReporter() {
        return new LoggingResultReporter();
    }
}
